import QtQuick 2.5

Item {
    id:root
    signal bntClicked()
    property string bntText;
    property bool selected:false
    width: 120
    height: 60
    Rectangle{
        id:cap
        anchors.centerIn: parent
        width:parent.width-20
        height:parent.height-20
        color:"#aaaaaa"
        opacity: selected?0.3:0
        radius: 3
        Behavior on opacity{
            PropertyAnimation{
                properties: "opacity"
                duration: 200
            }
        }
    }
    Rectangle{
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.bottom: parent.bottom
        width: parent.width-40
        height: 3
        color:"#12aaef"
        opacity: selected?1:0
        radius: 3
        Behavior on opacity{
            PropertyAnimation{
                properties: "opacity"
                duration: 200
            }
        }
    }

    Text{
        color:"#12aafa"
        anchors.centerIn: parent
        text:bntText
        font.pointSize: 18
        font.bold: selected
    }


    MouseArea{
        anchors.fill: parent
        onClicked: bntClicked();
    }

}
